﻿using System;
using UnityEngine;

// Token: 0x02000363 RID: 867
public static class Sbox
{
	// Token: 0x06001671 RID: 5745 RVA: 0x00091D5A File Offset: 0x0008FF5A
	public static float Distance2d(Vector3 a, Vector3 b)
	{
		return Sbox.Distance2dAxis(a.x, a.z, b.x, b.z);
	}

	// Token: 0x06001672 RID: 5746 RVA: 0x00091D80 File Offset: 0x0008FF80
	public static float Distance2dAxis(float a1, float a2, float b1, float b2)
	{
		Vector2 a3 = new Vector2(a1, a2);
		Vector2 b3 = new Vector2(b1, b2);
		return Vector2.Distance(a3, b3);
	}

	// Token: 0x06001673 RID: 5747 RVA: 0x00091DA6 File Offset: 0x0008FFA6
	public static float Distance1d(float a, float b)
	{
		return Mathf.Abs(a - b);
	}

	// Token: 0x06001674 RID: 5748 RVA: 0x00091DB0 File Offset: 0x0008FFB0
	public static float Distance1dLiteral(float source, float target)
	{
		if (source > target)
		{
			return -Mathf.Abs(target - source);
		}
		return Mathf.Abs(target - source);
	}

	// Token: 0x06001675 RID: 5749 RVA: 0x00091DCB File Offset: 0x0008FFCB
	public static float SetScale(float BaseDistance, float scale)
	{
		return BaseDistance * (1f / scale);
	}

	// Token: 0x06001676 RID: 5750 RVA: 0x00091DD6 File Offset: 0x0008FFD6
	public static float GetScale(float RelativeDistance, float scale)
	{
		return RelativeDistance * scale;
	}

	// Token: 0x06001677 RID: 5751 RVA: 0x00091DDB File Offset: 0x0008FFDB
	public static float ScaleToMeter(float scale)
	{
		return scale / GameController.referenceScale;
	}

	// Token: 0x06001678 RID: 5752 RVA: 0x00091DE4 File Offset: 0x0008FFE4
	public static float MeterToScale(float scale)
	{
		return scale * GameController.referenceScale;
	}
}
